package com.nova.view;

import android.content.Context;
import android.content.SharedPreferences;

public class BaseSharedPreferencesUtil
{
	// private static final String FILENAME = "nova_reminder";

	public static void saveStr(Context con, String fileName, String key,
			String value)
	{
		SharedPreferences sp = con.getSharedPreferences(fileName, 0);
		sp.edit().putString(key, value).commit();
	}

	public static String getStr(Context con, String fileName, String key)
	{
		SharedPreferences sp = con.getSharedPreferences(fileName, 0);
		return sp.getString(key, "");
	}

	public static void saveBoolean(Context con, String fileName, String key,
			boolean value)
	{
		SharedPreferences sp = con.getSharedPreferences(fileName, 0);
		sp.edit().putBoolean(key, value).commit();
	}

	public static boolean getBoolean(Context con, String fileName, String key)
	{
		SharedPreferences sp = con.getSharedPreferences(fileName, 0);
		return sp.getBoolean(key, false);
	}

	public static void saveInt(Context con, String fileName, String key,
			int value)
	{
		SharedPreferences sp = con.getSharedPreferences(fileName, 0);
		sp.edit().putInt(key, value).commit();
	}

	public static int getInt(Context con, String fileName, String key)
	{
		SharedPreferences sp = con.getSharedPreferences(fileName, 0);
		return sp.getInt(key, 0);
	}
}
